package com.rox.webapi.controler;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @description:
 * @author: liupeng
 * @create: 2021-04-22 17:48
 **/
@RestController
public class TestAPIController {

    //读取配置中心的参数
    @Value("${server.port}")
    private String port;

    @RequestMapping("test/page1")
    public String page1(){
        return "webAPI page1. current time:"+(new Date()).toString();
    }

    @RequestMapping("test/rox")
    public String page2(){return "webAPI page2.server.port="+port;}
}